package cn.chendd;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * Open Feign 程序入口
 *
 * @author chendd
 * @date 2023/1/8 19:51
 */
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients(basePackages = "cn.chendd.**.client")
@EnableHystrix
public class OpenFeignApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(OpenFeignApplication.class, args);
        ///输出所有的spring 组件
        /*String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
        Arrays.stream(beanDefinitionNames).forEach(beanName -> {
            System.out.println(beanName + "\t20" + applicationContext.getBean(beanName));
        });*/
    }

}
